<div th:fragment="sidebar" id="sidebar" class="sidebar responsive ace-save-state"
     xmlns:th="http://www.w3.org/1999/xhtml">
    <script type="text/javascript">
        try {
            ace.settings.loadState('sidebar')
        } catch (e) {
        }

        /**
         * 退出登录
         */
        function logout() {
            if (confirm("确定退出系统？")) {
                window.location.href = "/logout";
            }
        }

        /**
         * 修改密码
         */
        function password_edit() {
            $("#modal2").modal({
                remote: "/system/password_edit"
            });
        }

        /**
         * 跳转
         */
        function report_list() {
            window.location.href = "/report/report_list";
        }

        /**
         * 跳转台账信息
         */
        function monitor() {
            window.location.href = "/monitor/monitor?isQuick=1";
        }
    </script>

    <div class="sidebar-shortcuts" id="sidebar-shortcuts">
        <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
            <button class="btn btn-success" onclick="report_list()">
                <i class="ace-icon fa fa-signal"></i>
            </button>
            <button class="btn btn-info" onclick="monitor()">
                <i class="ace-icon fa fa-cogs"></i>
            </button>
            <button class="btn btn-warning" onclick="password_edit()">
                <i class="ace-icon fa fa-pencil"></i>
            </button>
            <button class="btn btn-danger" onclick="logout()">
                <i class="ace-icon fa fa-power-off"></i>
            </button>
        </div>

        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
            <span class="btn btn-success"></span>
            <span class="btn btn-info"></span>
            <span class="btn btn-warning"></span>
            <span class="btn btn-danger"></span>
        </div>
    </div><!-- /.sidebar-shortcuts -->

    <ul class="nav nav-list">
        <li th:each="menu,meunStat : ${menus}" class="">
            <!--IF menu has url 也就是说有url的时候-->
            <a class="sub_url" th:if="${menu.url != ''}" th:text="${menu.title}" th:href="${menu.url}"
               th:utext="|<i class='${menu.cssClass}'></i> <span class='menu-text'>${menu.title}</span> <b class='arrow  fa fa-angle-right'></b> |">
                未正确加载菜单
            </a>
            <!--IF menu has not url 也就是说没有url的时候-->
            <a th:if="${menu.url == ''}"
               th:utext="|<i class='${menu.cssClass}'></i> <span class='menu-text'>${menu.title}</span> <b class='arrow  fa fa-angle-down'></b> |"
               href="#" class="dropdown-toggle">
                未正确加载菜单
            </a>
            <b th:if="${menu.url == ''}" class="arrow"></b>
            <ul th:if="${menu.url == ''}" class="submenu" style="display: none;">
                <li th:each="subMenu, subMenuStat : ${menu.subMenu}" class="sub_menu">
                    <a class="sub_url" th:text="${subMenu.title}" th:href="${subMenu.url}">
                        未正确加载菜单
                    </a>
                    <b class="arrow"></b>
                </li>
            </ul>
        </li>
    </ul><!-- /.nav-list -->
    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state"
           data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>
</div>

